package dbu;

import java.sql.SQLException;
import java.util.Collection;
import java.util.Vector;

import dbu.jdbc.JdbcResultSetMetaData;

// TODO not public
public final class Data {

	private Vector<Object[]> data = new Vector<Object[]>();
	private JdbcResultSetMetaData meta;

	public Data(JdbcResultSetMetaData meta) {
		this.meta = meta;
	}

	public JdbcResultSetMetaData getMeta() {
		return meta;
	}

	public int size() {
		return data.size();
	}

	public String getString(int index, int columnIndex) throws SQLException {
		return (String) data.elementAt(index)[columnIndex];
	}

	public void addData(Object[] data) {
		this.data.add(data);
	}

	public void addData(Collection<Object[]> data) {
		this.data.addAll(data);
	}
}
